package jrain.fw.log;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * <pre>
 * 作者：489088214@qq.com 
 * 描述： Log4j2 日志适配
 * </pre>
 */
public class Log4j2Impl implements jrain.fw.core.log.Logger {

	private Logger log;

	public Log4j2Impl(Logger log) {
		this.log = log;
	}

	public Log4j2Impl(String loggerName) {
		log = LogManager.getLogger(loggerName);
	}

	public Logger getLog() {
		return log;
	}

	public String toString() {
		return log.toString();
	}

	public boolean isTraceEnabled() {
		return log.isTraceEnabled();
	}

	public boolean isDebugEnabled() {

		return log.isDebugEnabled();
	}

	public boolean isInfoEnabled() {
		return log.isInfoEnabled();
	}

	public boolean isWarnEnabled() {

		return log.isWarnEnabled();
	}

	public boolean isErrorEnabled() {
		return log.isErrorEnabled();
	}

	public void trace(String msg) {
		log.trace(msg);
	}

	public void trace(String format, Object... argArray) {
		log.trace(format, argArray);
	}

	public void debug(String msg) {
		log.debug(msg);
	}

	public void debug(String format, Object... argArray) {
		log.debug(format, argArray);
	}

	public void debug(String msg, Throwable t) {
		log.debug(msg, t);
	}

	public void info(String msg) {
		log.info(msg);
	}

	public void info(String format, Object... argArray) {
		log.info(format, argArray);
	}

	public void info(String msg, Throwable t) {
		log.info(msg, t);
	}

	public void warn(String msg) {
		log.warn(msg);
	}

	public void warn(String format, Object... argArray) {
		log.warn(format, argArray);
	}

	public void warn(String msg, Throwable t) {
		log.warn(msg, t);
	}

	public void error(String msg) {
		log.error(msg);
	}

	public void error(String format, Object... argArray) {
		log.error(format, argArray);
	}

	public void error(String msg, Throwable t) {
		log.error(msg, t);

	}

}
